﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entidad;
using Negocio;
using System.Data;
using System.IO;
using System.Dynamic;


namespace SIGEIN_EPG_Programas
{
    public partial class Default: System.Web.UI.Page
    {
        DataSet dsprogra;
        Entidad.Programa entidadPrograma;
        Negocio.Programa programaNeg;

        protected void Page_Load(object sender, EventArgs e)
      {
     
           entidadPrograma = new Entidad.Programa();
           programaNeg = new Negocio.Programa();

           this.listar();
        }

        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            entidadPrograma = new Entidad.Programa(ddtipoProg.Text, tnombre.Text, CKEditor1.Text, CKEditor2.Text, CKEditor3.Text, CKEditor4.Text, CKEditor5.Text, CKEditor6.Text, CKEditor7.Text, double.Parse(tinscripcion.Text), double.Parse(tmatricula.Text), double.Parse(tpension.Text),tmetadatos.Text, turl.Text, ddplanestudio.Text, dddacargo.Text);
            programaNeg.AgregarPrograma(entidadPrograma);
        }

        public void listar()
            {
                dsprogra = programaNeg.ListarProgramas();
                dgvProgramas.DataSource = dsprogra;
                dgvProgramas.DataMember = "PROGRAMAS";
                dgvProgramas.DataBind();

            }
    }
}
